export function InitMap() {
    return new Promise(function(resolve, reject) {
      window.init = function(ret) {
        resolve(ret)
      }
      var script = document.createElement('script')
      script.type = 'text/javascript'
      script.src = 'https://map.qq.com/api/js?v=2.exp&callback=init&key=FYHBZ-XDAWF-7UCJN-JIH44-UKENZ-2EBU4'
    //   script.src = 'https://apis.map.qq.com/ws/place/v1/search?keyword=酒店&key=FYHBZ-XDAWF-7UCJN-JIH44-UKENZ-2EBU4'
      script.onerror = reject
      document.body.appendChild(script)
    })
}
export function ToEnd(url) {
    return new Promise(function(resolve, reject) {
      window.To = function(ret) {
        resolve(ret)
      }
      var script = document.createElement('script')
      script.src = url
      document.body.appendChild(script)
    })
}